package com.cisetech.web.bobocai.houtai;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.cisetech.mapper.bobocai.TitleMapper;
import com.cisetech.vo.bobocai.TitleVo;
/**
 * 网站设置
 * @author Administrator
 *
 */
@Controller
@RequestMapping(value="/website")
public class WebsiteController {
	
	@Autowired
	TitleMapper titleMapper;
	
	@RequestMapping(value="",method=RequestMethod.GET)
	public ModelAndView index(HttpServletRequest request , HttpServletResponse response){
		TitleVo titleVo = new TitleVo();
		//设置获取网站首页的title信息
		titleVo.setPrId("0");
		List<TitleVo> list = titleMapper.findTitleHeadByPrId(titleVo);
		ModelAndView m = new ModelAndView("houtai/website");
		if(list!=null && list.size()>0){
			m.addObject("titleVo", list.get(0));
		}else{
			m.addObject("titleVo", new TitleVo());
		}
		return m;
	}
}
